const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  user: state => state.app.user,
  token: state => state.user.token,
  dialog: state => state.app.dialog,
  userId: state => state.user.userId,
  avatar: state => state.user.avatar,
  name: state => state.user.name,
  visitedViews: state => state.tagsView.visitedViews, // 新增
  cachedViews: state => state.tagsView.cachedViews,
  miniCompareFlag: state => {
    const homeObj = state.app.miniChangeObj
    const myObj = state.app.miniCompareMy
    const tabbarFlag = state.app.tabberFlag
    const themeFlag = state.app.themeFlag
    let count = 0
    for (const key in homeObj) {
      if (homeObj[key]) {
        count++
      }
    }
    for (const key in myObj) {
      if (myObj[key]) {
        count++
      }
    }
    if (tabbarFlag || themeFlag) {
      count++
    }
    return count > 0
  }
}
export default getters
